package com.woniu.ssm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniu.ssm.domian.User;
import com.woniu.ssm.mapper.UserMapper;


@Service
@Transactional
public class UserServiceImpl implements IUserService {
	
	@Autowired
	UserMapper userMapper ;

	@Override
	public User findUserByName(String name) {
		// TODO Auto-generated method stub
		return userMapper.selectUserByName(name);
	}

	@Override
	public void add(User user) {
		// TODO Auto-generated method stub
		userMapper.insert(user);
	}

	@Override
	public void modify(User user) {
		// TODO Auto-generated method stub
		userMapper.update(user);
	}

	@Override
	public void remove(int id) {
		// TODO Auto-generated method stub
		userMapper.del(id);
	}

	@Override
	public List<User> findList() {
		// TODO Auto-generated method stub
		return userMapper.selectUser();
	}

	@Override
	public User findUserById(int uid) {
		return userMapper.selectUserById(uid);
	}

}
